#ifndef evdictstruct_h
#define evdictstruct_h

/*
	Ten file: evdictstruct.h
	(E-V dictionary structure)
	To chuc cac cau truc dung trong chuong trinh
*/

#define MAX_WORD_LENGTH 20
#define MAX_PART_OF_SPEECH_LENGTH 10
#define MAX_MEAN_LENGTH 100
#define MAX_EXAMPLE_LENGTH 100
#define HASH_CODE_LENGTH 4

#define DICTIONARY_DATA_FILE "Dictionanry.dat"
#define DICTIONARY_INDEX_FILE "Index.dat"
#define DICTIONARY_BACKUP_FILE "Backup.dat"

//typedef signed char boolean;

// Cau truc cua 1 tu luu tru trong file Dictionary.dat
struct WordDefinition
{
	char word[MAX_WORD_LENGTH + 1];
	char partOfSpeech[MAX_PART_OF_SPEECH_LENGTH + 1]; // tu loai
	char mean[MAX_MEAN_LENGTH + 1];
	char example[MAX_EXAMPLE_LENGTH + 1];
};

// Cau truc cua 1 tu luu tru trong file Index.dat
struct WordIndex
{
	char word[MAX_WORD_LENGTH + 1];
	int address; // dia chi cua tu trong file Dictionary.dat
	char hashCode[HASH_CODE_LENGTH + 1];
};

// Cau truc cua danh sach lien ket luu tru cac tu co cung ma bam
struct WordList
{
	char word[MAX_WORD_LENGTH + 1];
	int address;
	WordList *next;
};

struct BackupWord
{
	int address;
	struct BackupWord * next;
};


#endif